﻿<UserControl x:Class="Skyper.View.Panorama.ContactsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
			 xmlns:ctrl="clr-namespace:Skyper.Controls"
	xmlns:tilt="clr-namespace:Skype.Skyper"
			 xmlns:vm="clr-namespace:Skyper.ViewModel"
		xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480"
			 >
	<UserControl.Resources>
		<ControlTemplate x:Key="ButtonLess" TargetType="Button">
			<ContentPresenter VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
		</ControlTemplate>
		<DataTemplate x:Key="contactTemplate">
            <Grid Margin="5" Background="{StaticResource PhoneBackgroundBrush}" MouseLeftButtonDown="Contact_MouseLeftButtonDown" MouseLeftButtonUp="Contact_MouseLeftButtonUp" MouseLeave="Contact_MouseLeave">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="*" />
				</Grid.ColumnDefinitions>

				<Image Stretch="UniformToFill" Grid.Column="0" x:Name="avatarImage" Height="100" Width="100" Source="{Binding Avatar,Converter={StaticResource avatarConverter}}" MinWidth="100" MinHeight="100" MaxWidth="100" MaxHeight="100" />
				<StackPanel Grid.Column="1">
					<StackPanel Grid.Column="2">
						<TextBlock Text="{Binding FriendlyName}"  
								   Style="{StaticResource PhoneTextLargeStyle}" Foreground="{StaticResource PhoneAccentBrush}" />
						<TextBlock Text="{Binding Mood}" 
								   Visibility="{Binding Mood,Converter={StaticResource visibilityConverter}}" 
								   Style="{StaticResource PhoneTextNormalStyle}" 
								   TextWrapping="NoWrap" 
								   FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
					</StackPanel>
					<!-- Mobile -->
					<StackPanel Orientation="Horizontal" Visibility="{Binding PhoneMobile,Converter={StaticResource visibilityConverter}}">
						<TextBlock Text="Mobile:" Style="{StaticResource PhoneTextSmallStyle}"/>
						<TextBlock Text="{Binding PhoneMobile}" Style="{StaticResource PhoneTextSmallStyle}" FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
					</StackPanel>
					
				</StackPanel>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>
	<!-- <toolkit:LongListSelector x:Name="buddies" ItemsSource="{Binding Available}" IsFlatList="True" IsBouncy="True" ShowListFooter="False" ShowListHeader="False" ItemTemplate="{StaticResource contactTemplate}"> 

	</toolkit:LongListSelector>
	-->
	<ItemsControl ItemsSource="{Binding Contacts,Mode=OneWay,NotifyOnValidationError=True}" ItemTemplate="{StaticResource contactTemplate}">
		<ItemsControl.Template>
			<ControlTemplate>
				<ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}">
					<ItemsPresenter />
				</ScrollViewer>
			</ControlTemplate>
		</ItemsControl.Template>
	</ItemsControl>
</UserControl>
<!--
	Remminder
	{Binding IsSelected,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource visibilityConverter}}
-->